﻿namespace DimensionsHelper.ExcelAddIn.Core.Sql;

/// <summary>
/// SQL 设置的标识符集合
/// </summary>
public class HeaderIdentifiersTransmission
{
    /// <summary>
    /// ID 标识符
    /// </summary>
    public string? Id { get; set; }

    /// <summary>
    /// 字段标识符
    /// </summary>
    public string? Field { get; set; }

    /// <summary>
    /// 字段值标识符
    /// </summary>
    public string? Value { get; set; }

    /// <summary>
    /// 移除值标识符
    /// </summary>
    public string? ValueToRemove { get; set; }

    /// <summary>
    /// 其他值标识符
    /// </summary>
    public string? Extra { get; set; }


    public HeaderIdentifiers ToSettings()
    {
        return new HeaderIdentifiers
        {
            Id = Id.GetIdentifiers(),
            Field = Field.GetIdentifiers(),
            Value = Value.GetIdentifiers(),
            ValueToRemove = ValueToRemove.GetIdentifiers(),
            Extra = Extra.GetIdentifiers()
        };
    }


    public void ToSettings(HeaderIdentifiers settings)
    {
        settings.Id = Id.GetIdentifiers();
        settings.Field = Field.GetIdentifiers();
        settings.Value = Value.GetIdentifiers();
        settings.ValueToRemove = ValueToRemove.GetIdentifiers();
        settings.Extra = Extra.GetIdentifiers();
    }

}

